import os
import pytest

from tools.excel_utils import read_excel_cell
from tools.get_week_day_start_end_from_str import get_week_day_start_end_from_str

@pytest.mark.parametrize("input_cell, expected_dict", [
    ("E20",{"week":2,"day":2,"start":6}),

])
def test_get_week_day_start_end_from_str(input_cell,expected_dict):
    file_path = "tools/read_excel_range_as_list_of_dictionary_test_data.xlsx"
    sheet_name = "TestSheet"
    result = read_excel_cell(file_path, sheet_name,input_cell)
    week_day_start=get_week_day_start_end_from_str(result)
    assert week_day_start == expected_dict



@pytest.mark.parametrize("input_str, expected_dict", [
    ("2025-04-08 13:01:20的签到",{"week":9,"day":2,"start":6}),
    ('2025-03-11 07:57:47的签到', {"week": 5, "day": 2, "start": 1}),


])
def test_get_week_day_start_end_from_str_2(input_str,expected_dict):
    week_day_start=get_week_day_start_end_from_str(input_str)
    assert week_day_start == expected_dict
